package com.seari.service.impl;

import com.seari.bean.User;
import com.seari.mapper.DevMaintenanceMapper;
import com.seari.pojo.DevMaintenancePlanPojo;
import com.seari.pojo.MaintenancePlanParam;
import com.seari.pojo.TreeDataPojo;
import com.seari.service.DevMaintenanceSerivce;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DevMaintenanceServiceImpl implements DevMaintenanceSerivce {

    @Autowired
    private DevMaintenanceMapper devMaintenanceMapper;
    /**
     * 获取专业，系统，设备类型数据
     * @return
     */
    @Override
    public List<TreeDataPojo> getTreeData() {
        return devMaintenanceMapper.getTreeData();
    }

    /**
     * 查询维修计划列表
     * @param param
     * @return
     */
    @Override
    public List<DevMaintenancePlanPojo> getMaintenancePlanList(MaintenancePlanParam param) {
        return devMaintenanceMapper.getMaintenancePlanList(param);
    }

    /**
     * 查询所有用户
     * @return
     */
    @Override
    public List<User> findAllUser() {
        return devMaintenanceMapper.findAllUser();
    }

    /**
     * 更新距离下次维修的天数
     * @param list
     */
    @Override
    public void updateDevSubMaintenancePlanDays(List<DevMaintenancePlanPojo> list) {
        devMaintenanceMapper.updateDevSubMaintenancePlanDays(list);
    }
}
